#include "main_header.h"

int use_mkdir(char *toPath ,char *abosule,char *filename,char *ret){
    char path[1024] = {0} ;
    char abo[1024] = {0};
    mode_t mode = 0666;
    unsigned int num = (unsigned int)mode;
    printf("!!!!!!!!!!!!!!!!\n");
    strcpy(abo,abosule);
    if(strncmp(filename,"/",1)==0){
        strcat(abo,filename);
        int tmp = mkdir(abo,num);
        if(tmp == 0){
            strcpy(ret,"创建成功");
        }else{
            strcpy(ret,"创建失败！！！");
        }  
        return 0;

    }
    printf("@@@@@@@@@@@@@\n");
    strcpy(path,toPath);
    strcat(path,"/");
    strcat(path,filename);

    int tmp = mkdir(path,num);
    if(tmp == 0){
        strcpy(ret,"创建成功");
    }else{
        strcpy(ret,"创建失败！！！");
    }
    printf("#################\n");
    return 0;
}




int use_rmdir(dirStack_t *dir,char *command,char *ret){
    int tmp = rmdir(command);
    if(tmp == 0){
        strcpy(ret,"删除成功");
    }else{
        strcpy(ret,"删除失败");
    }
    popStack(dir);
    popStack(dir);
    return 0;
}








